package com.hospital.hospitalserver.controller;

import com.hospital.hospitalserver.entity.query.PaymentQuery;
import com.hospital.hospitalserver.service.PaymentService;
import com.hospital.hospitalserver.util.Response;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 收费信息相关实现API接口
 * */
@CrossOrigin
@RestController
@RequiredArgsConstructor
@RequestMapping("/billing")
public class PaymentController {
    private final PaymentService paymentService;

    /**
     * 管理端查询收费分页信息API接口
     * 装载数据
     */
    @PostMapping("/getPaymentPagerDataBySearch")
    public Response getPaymentPagerDataBySearch(@RequestBody PaymentQuery query){
        return paymentService.getPaymentPagerDataBySearch(query);
    }

    /**
     * 根据收费ID获取收费详情API接口
     */
    @PostMapping("/getPaymentDetailById")
    public Response getPaymentDetailById(@RequestBody PaymentQuery query){
        return paymentService.getPaymentDetailById(query.getPaymentId());
    }
}
